-- GENERATED SPELL FOR [Ethereal Spellbinder] --


function spell0_18312(pUnit, Event) --@Counterspell,n/a--
pUnit:FullCastSpellOnTarget(37470,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18312', 3298, 1)
end

function spell1_18312(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(17883,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18312', 23000, 1)
end

function spell2_18312(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(37668,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18312', 23000, 1)
end

function spell3_18312(pUnit, Event) --@Summon Ethereal Wraith,n/a--
pUnit:FullCastSpellOnTarget(32316,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18312', 507, 1)
end

function Sorts_18312(pUnit, Event)
local choix_sorts_18312 = math.random(0, 3)
if choix_sorts_18312 == 0 then
pUnit:RegisterEvent('spell0_18312', 1, 1)
end
if choix_sorts_18312 == 1 then
pUnit:RegisterEvent('spell1_18312', 1, 1)
end
if choix_sorts_18312 == 2 then
pUnit:RegisterEvent('spell2_18312', 1, 1)
end
if choix_sorts_18312 == 3 then
pUnit:RegisterEvent('spell3_18312', 1, 1)
end
end

function mob18312_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18312', math.random(1500, 3000), 1)
end

function mob18312_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18312_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18312_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18312, 1, 'mob18312_Action')
RegisterUnitEvent(18312, 2, 'mob18312_Leave')
RegisterUnitEvent(18312, 3, 'mob18312_Kill')
RegisterUnitEvent(18312, 4, 'mob18312_Die')
